let client_id = "Nc8AbYoTGc6pIBfvcXHb4WbX";
let client_secret = "SN9EHkPdoweQg91hEoc1nCxmFi5pAY6b";

// 老照片
/* 

AppID  23728242 
API Key  Nc8AbYoTGc6pIBfvcXHb4WbX
Secret Key    SN9EHkPdoweQg91hEoc1nCxmFi5pAY6b

*/

/* 

APIkey：0nk3xixiw8ZhhvNghD0VwTFa   
secret：I4nAtUDPSgX77qv0LvXj6LK5Z5qprY1n 

*/

const getToken = () => {
    return new Promise((r, j) => {
        uni.request({
            // #ifdef H5
            url: `/oauth/2.0/token?grant_type=client_credentials&client_id=${client_id}&client_secret=${client_secret}`,
            // #endif
            // #ifndef H5
            url: `https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=${client_id}&client_secret=${client_secret}`,
            // #endif
            success: res => {
                r(res.data);
            },
            fail: err => {
                j(err);
            },
        });
    });
};
export default getToken;
